package com.liyk.shop.service.impl;

import com.liyk.shop.service.BaseService;
import com.liyk.shop.tkmapper.BaseMapper;
import org.springframework.beans.factory.annotation.Autowired;

public class BaseServiceImpl<T, D extends BaseMapper<T>> implements BaseService<T> {

    @Autowired
    D mapper;


    @Override
    public int insertSelective(T t) {
        return mapper.insertSelective(t);
    }

    @Override
    public int delete(T t) {
        return mapper.delete(t);
    }

    @Override
    public int updateSelective(T t) {
        return mapper.updateByPrimaryKeySelective(t);
    }

    @Override
    public T get(T t) {
        return mapper.selectOne(t);
    }

    @Override
    public long count(T t) {
        return mapper.selectCount(t);
    }
}
